package ControlLayer;
import ModelLayer.*;
import java.util.ArrayList;
/**
 * Write a description of class LeaseCtr here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class LeaseCtr
{
    // instance variables - replace the example below with your own
    private LeaseContainer leaseContainer;

    /**
     * Constructor for objects of class LeaseHandler
     */
    public LeaseCtr()
    {
        leaseContainer = LeaseContainer.getInstance();
    }
    
    public void addLease(Lease lease)
    {
        leaseContainer.addLease(lease);
    }
    
    public void updateLease(Lease lease, String id, String leaseDate, String returnDate, int period, String state, int discount)
    {
        lease.setId(id);
        lease.setLeaseDate(leaseDate);
        lease.setReturnDate(returnDate);
        lease.setPeriod(period);
        lease.setState(state);
        lease.setDiscount(discount);
    }
    
    public Lease findLease(String id)
    {
        return leaseContainer.findLease(id);
    }
    
    public void deleteLease(Lease lease)
    {
        leaseContainer.deleteLease(lease);
    }
    
    public ArrayList<Lease> getLeaseList() 
    {
     return leaseContainer.getLeaseList();
    }
}
